"use strict";
cc._RF.push(module, 'f0a89HtGGhNBpdAYDHpyqi/', 'OppoAd');
// scripts/OppoAd.js

"use strict";

var e = require;
var t = module;
var o = exports;

var _ii,
    nn = void 0 && (void 0).__extends || (_ii = function ii(t, e) {
  return (_ii = Object.setPrototypeOf || {
    __proto__: []
  } instanceof Array && function (t, e) {
    t.__proto__ = e;
  } || function (t, e) {
    for (var o in e) {
      Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
    }
  })(t, e);
}, function (t, e) {
  function o() {
    this.constructor = t;
  }

  _ii(t, e), t.prototype = null === e ? Object.create(e) : (o.prototype = e.prototype, new o());
}),
    rr = void 0 && (void 0).__awaiter || function (t, e, o, i) {
  return new (o || (o = Promise))(function (n, a) {
    function r(t) {
      try {
        l(i.next(t));
      } catch (e) {
        a(e);
      }
    }

    function s(t) {
      try {
        l(i["throw"](t));
      } catch (e) {
        a(e);
      }
    }

    function l(t) {
      var e;
      t.done ? n(t.value) : (e = t.value, e instanceof o ? e : new o(function (t) {
        t(e);
      })).then(r, s);
    }

    l((i = i.apply(t, e || [])).next());
  });
};

var oo = void 0 && (void 0).__decorate || function (e, t, a, n) {
  var i,
      o = arguments.length,
      s = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, a) : n;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) s = Reflect.decorate(e, t, a, n);else for (var r = e.length - 1; r >= 0; r--) {
    (i = e[r]) && (s = (o < 3 ? i(s) : o > 3 ? i(t, a, s) : i(t, a)) || s);
  }
  return o > 3 && s && Object.defineProperty(t, a, s), s;
};

Object.defineProperty(o, "__esModule", {
  value: !0
});
var a = e("LoadRes"),
    n = e("sdkConfig"),
    i = e("AdInterface"),
    r = cc._decorator,
    s = r.ccclass,
    l = (r.property, function (e) {
  function t() {
    var t = null !== e && e.apply(this, arguments) || this;
    return t.game_version = "102", t.app_test_version = !1, t.videoAd = null, t.loadSucc_Video = null, t.callback_Video = null, t.nativeIconAd = null, t.nativeIconInfo = null, t.loadSucc_NativeIcon = !1, t.nativeImageAd = null, t.nativeImageInfo = null, t.loadSucc_NativeImage = !1, t.nativeInfoRes = null, t.loadSucc_NativeInfo = !1, t.loadSucc_Banner = !1, t.bannerAd = null, t.loadSucc_SystemBanner = !1, t.nativeBannerAd = null, t.nativeBannerInfo = null, t.loadSucc_NativeAdBanner = !1, t.node_nativeBanner = null, t.NUM_CheckBannerLoadSucc = 0, t.NUM_MaxCheckBannerLoadSucc = 5, t.hasShowBanner = !1, t.isShow_SystemBanner = !1, t.isShow_NativeBanner = !1, t.interval_updateBanner = null, t.timeout_showSystemBanner = null, t.timeout_checkBannerLoadSucc = null, t.customIntersAd = null, t.navigateBoxBannerAd = null, t.loadSucc_NavigateBoxBanner = !1, t.temp_hasShowBanner = !1, t.navigateBoxPortalAd = null, t.loadSucc_NavigateBoxPortal = !1, t.isShow_NavigateSettle = !1, t;
  }

  return nn(t, e), t.prototype.GameVersion = function (e) {
    this.app_test_version = this.game_version == e;
  }, t.prototype.getGameTestVersion = function () {
    return this.app_test_version;
  }, t.prototype.createAd = function () {
    (this.SW_Native_Banner || this.SW_Native_Icon || this.SW_Native_Image || this.SW_Native_Inters) && this.nativeInfoResArr(), this.SW_Video && "" != this.ID_Video && this.createVideo(), this.SW_System_Banner && "" != this.ID_System_Banner && this.createSystemBanner(), this.SW_Native_Banner && "" != this.ID_Native_Banner && this.loadNativeBannerRes(), this.SW_Native_Icon && "" != this.ID_Native_Icon && this.createNativeIcon(), this.SW_Native_Image && "" != this.ID_Native_Image && this.createNativeImage(), this.SW_Box_Banner && "" != this.ID_Box_Banner && this.createNavigateBoxBanner(), this.SW_Box_View && "" != this.ID_Box_View && this.createNavigateBoxPortal(), qg.setKeepScreenOn({
      keepScreenOn: !0
    });
  }, t.prototype.createVideo = function () {
    var e = this;
    n["default"].stringHasSpace(this.ID_Video) ? console.log(n["default"].GameName + "********当前渠道视频广告ID中含有空字符串,请检查后台视频广告ID*********************") : (console.log("OPPO 创建视频广告"), this.videoAd = qg.createRewardedVideoAd({
      adUnitId: this.ID_Video
    }), this.videoAd.onLoad(function () {
      console.log("OPPO 视频广告加载完成"), e.loadSucc_Video = !0;
    }), this.videoAd.onError(function (t) {
      console.log("OPPO 视频加载失败：", JSON.stringify(t)), e.videoAd && setTimeout(function () {
        e.videoAd && e.videoAd.load();
      }, 3e4);
    }), this.videoAd.onClose(function (t) {
      t.isEnded ? (console.log("OPPO 激励视频广告完成，发放奖励"), e.callback_Video && (e.callback_Video(!0), e.videoAd.load())) : (console.log("OPPO 激励视频广告关闭，不发放奖励"), e.callback_Video && (e.callback_Video(!1), e.videoAd.load()));
    }), this.videoAd.load());
  }, t.prototype.getVideoFlag = function () {
    return this.loadSucc_Video;
  }, t.prototype.showVideo = function (e) {
    this.videoAd && this.loadSucc_Video && (this.callback_Video = e, this.videoAd.show());
  }, t.prototype.createNativeIcon = function () {
    var e = this;
    n["default"].stringHasSpace(this.ID_Native_Icon) ? console.log("当前渠道系统原生Icon广告ID中含有空字符串,请检查后台原生Icon广告ID*********************") : (console.log("OPPO 创建原生Icon广告"), this.nativeIconAd = qg.createNativeAd({
      adUnitId: this.ID_Native_Icon
    }), this.nativeIconInfo = {
      adId: null,
      Native_icon: null,
      Native_BigImage: null
    }, this.nativeIconAd.onLoad(function (t) {
      console.log("OPPO 原生Icon广告加载成功", JSON.stringify(t.adList));
      var o = 0;
      null != typeof t.adList && 0 != t.adList.length ? (o = t.adList.length - 1, console.log("OPPO 原生Icon广告拉取:" + JSON.stringify(t.adList[o])), e.nativeIconInfo.adId = String(t.adList[o].adId), t.adList && 0 != t.adList[o].iconUrlList.length ? (e.nativeIconInfo.Native_icon = t.adList[o].iconUrlList[0], e.loadSucc_NativeIcon = !0) : t.adList && 0 != t.adList[o].imgUrlList.length ? (e.nativeIconInfo.Native_BigImage = t.adList[o].imgUrlList[0], e.loadSucc_NativeIcon = !0) : (e.nativeIconInfo.Native_BigImage = null, e.nativeIconInfo.Native_icon = null, e.loadSucc_NativeIcon = !1, console.log("OPPO 原生Icon加载失败"))) : console.log("OPPO 原生广告列表为空 return");
    }), this.nativeIconAd.onError(function (e) {
      console.log("OPPO 原生Icon广告加载失败：", JSON.stringify(e));
    }), this.nativeIconAd.load(), setInterval(function () {
      e.nativeIconAd && e.nativeIconAd.load();
    }, 1e3 * this.Control_Native_Update));
  }, t.prototype.createNativeImage = function () {
    var e = this;
    n["default"].stringHasSpace(this.ID_Native_Image) ? console.log("当前渠道系统原生自定义大图广告ID中含有空字符串,请检查后台原生自定义大图广告ID*********************") : (console.log("OPPO 创建原生自定义大图广告"), this.nativeImageAd = qg.createNativeAd({
      adUnitId: this.ID_Native_Image
    }), this.nativeImageInfo = {
      adId: null,
      title: null,
      desc: null,
      Native_icon: null,
      Native_BigImage: null,
      clickBtnTxt: null
    }, this.nativeImageAd.onLoad(function (t) {
      console.log("OPPO 原生大图广告加载成功", JSON.stringify(t.adList));
      var o = 0;
      null != typeof t.adList && 0 != t.adList.length ? (o = t.adList.length - 1, console.log("OPPO 原生大图广告拉取:" + JSON.stringify(t.adList[o])), e.nativeImageInfo.adId = String(t.adList[o].adId), e.nativeImageInfo.title = String(t.adList[o].title), e.nativeImageInfo.desc = String(t.adList[o].desc), e.nativeImageInfo.clickBtnTxt = String(t.adList[o].clickBtnTxt), t.adList && 0 != t.adList[o].imgUrlList.length ? (e.nativeImageInfo.Native_BigImage = t.adList[o].imgUrlList[0], e.loadSucc_NativeImage = !0) : t.adList && 0 != t.adList[o].iconUrlList.length ? (e.nativeImageInfo.Native_icon = t.adList[o].iconUrlList[0], e.loadSucc_NativeImage = !0) : (e.nativeImageInfo.Native_BigImage = null, e.nativeImageInfo.Native_icon = null, e.loadSucc_NativeImage = !1, console.log("OPPO 原生大图加载失败"))) : console.log("OPPO 原生广告列表为空 return");
    }), this.nativeImageAd.onError(function (e) {
      console.log("OPPO 原生自定义大图广告加载失败：", JSON.stringify(e));
    }), this.nativeImageAd.load(), setInterval(function () {
      e.nativeImageAd && e.nativeImageAd.load();
    }, 1e3 * this.Control_Native_Update));
  }, t.prototype.nativeInfoResArr = function () {
    var e = this;
    this.nativeInfoRes = {
      NativeBannerBg: null,
      NativeBannerButton: null,
      NativeBannerClose: null,
      NativeAdTip: null,
      NativeTestIcon: null,
      NativeTestImage: null,
      NativeIntersBg: null,
      NativeIntersClose: null,
      NativeIntersButton: null,
      NativeInterMask: null
    }, a["default"].loadResArray(["https://test2-1258404770.file.myqcloud.com/adInfo/SDK/SDKImage/Native/NativeBannerBg.png", "https://test2-1258404770.file.myqcloud.com/adInfo/SDK/SDKImage/Native/NativeBannerButton.png", "https://test2-1258404770.file.myqcloud.com/adInfo/SDK/SDKImage/Native/NativeClose.png", "https://test2-1258404770.file.myqcloud.com/adInfo/SDK/SDKImage/Native/NativeAdTip.png", "https://test2-1258404770.file.myqcloud.com/adInfo/SDK/SDKImage/Native/TestIcon.png", "https://test2-1258404770.file.myqcloud.com/adInfo/SDK/SDKImage/Native/TestImage.png", "https://test2-1258404770.file.myqcloud.com/adInfo/SDK/SDKImage/Native/NativeIntersBg.png", "https://test2-1258404770.file.myqcloud.com/adInfo/SDK/SDKImage/Native/NativeIntersClose.png", "https://test2-1258404770.file.myqcloud.com/adInfo/SDK/SDKImage/Native/NativeIntersButton.png", "https://test2-1258404770.file.myqcloud.com/adInfo/SDK/SDKImage/Native/NativeInterMask.png"], function (t, o) {
      e.nativeInfoRes.NativeBannerBg = o[0], e.nativeInfoRes.NativeBannerButton = o[1], e.nativeInfoRes.NativeBannerClose = o[2], e.nativeInfoRes.NativeAdTip = o[3], e.nativeInfoRes.NativeTestIcon = o[4], e.nativeInfoRes.NativeTestImage = o[5], e.nativeInfoRes.NativeIntersBg = o[6], e.nativeInfoRes.NativeIntersClose = o[7], e.nativeInfoRes.NativeIntersButton = o[8], e.nativeInfoRes.NativeInterMask = o[9], e.loadSucc_NativeInfo = !0;
    });
  }, t.prototype.getNativeImageAdFlag = function () {
    return this.loadSucc_NativeImage;
  }, t.prototype.getNativeIconAdFlag = function () {
    return this.loadSucc_NativeIcon;
  }, t.prototype.getNativeImageAdInfo = function () {
    return this.nativeImageInfo;
  }, t.prototype.getNativeIconAdInfo = function () {
    return this.nativeIconInfo;
  }, t.prototype.reportNativeImageAdShow = function () {
    this.nativeImageAd.reportAdShow({
      adId: this.nativeImageInfo.adId
    });
  }, t.prototype.reportNativeIconAdShow = function () {
    this.nativeIconAd.reportAdShow({
      adId: this.nativeIconInfo.adId
    });
  }, t.prototype.nativeImageClick = function () {
    this.nativeImageAd.reportAdClick({
      adId: this.nativeImageInfo.adId
    });
  }, t.prototype.nativeIconClick = function () {
    this.nativeIconAd.reportAdClick({
      adId: this.nativeIconInfo.adId
    });
  }, t.prototype.createSystemBanner = function () {
    var e = this;
    n["default"].stringHasSpace(this.ID_System_Banner) ? console.log("当前渠道系统banner广告ID中含有空字符串,请检查后台系统banner广告ID*********************") : (console.log("OPPO 创建系统banner广告====="), this.bannerAd = qg.createBannerAd({
      adUnitId: this.ID_System_Banner,
      style: {}
    }), this.loadSucc_SystemBanner = !0, this.bannerAd.onError(function (e) {
      console.log("OPPO 系统banner加载失败：", JSON.stringify(e));
    }), this.bannerAd.onHide(function () {
      console.log("OPPO 系统banner关闭", e.Control_Banner_Update + "S之后再次刷新"), e.hideBanner();
    }));
  }, t.prototype.loadNativeBannerRes = function () {
    var e = this;
    n["default"].stringHasSpace(this.ID_Native_Banner) ? console.log("当前渠道系统原生banner广告ID中含有空字符串,请检查后台原生banner广告ID*********************") : (console.log("OPPO 加载原生banner广告资源=====", this.ID_Box_Banner), this.loadSucc_NativeAdBanner = !1, this.nativeBannerAd = qg.createNativeAd({
      adUnitId: this.ID_Native_Banner
    }), this.nativeBannerInfo = {
      adId: null,
      title: null,
      desc: null,
      clickBtnTxt: null,
      Native_icon: null,
      Native_BigImage: null
    }, this.nativeBannerAd.onLoad(function (t) {
      console.log("OPPO 原生广告加载成功", JSON.stringify(t.adList));
      var o = 0;

      if (null != typeof t.adList && 0 != t.adList.length) {
        if (o = t.adList.length - 1, console.log("OPPO 原生广告拉取:" + JSON.stringify(t.adList[o])), e.nativeBannerInfo.adId = String(t.adList[o].adId), e.nativeBannerInfo.title = String(t.adList[o].title), e.nativeBannerInfo.desc = String(t.adList[o].desc), e.nativeBannerInfo.clickBtnTxt = String(t.adList[o].clickBtnTxt), t.adList && "" != t.adList[o].icon) {
          var n = function n(t) {
            e.nativeBannerInfo.Native_icon = t, e.loadSucc_NativeAdBanner = !0;
          };

          a["default"].loadResCustom(String(t.adList[o].icon), n);
        } else e.nativeBannerInfo.Native_icon = null, e.loadSucc_NativeAdBanner = !1;

        t.adList && 0 != t.adList[o].imgUrlList.length ? (n = function n(t) {
          e.nativeBannerInfo.Native_BigImage = t, e.loadSucc_NativeAdBanner = !0;
        }, a["default"].loadResCustom(String(t.adList[o].imgUrlList[0]), n)) : (e.nativeBannerInfo.Native_BigImage = null, e.loadSucc_NativeAdBanner = !1);
      } else console.log("OPPO 原生广告列表为空 return");
    }), this.nativeBannerAd.onError(function (e) {
      console.log("OPPO 原生广告banner加载失败：", JSON.stringify(e));
    }), this.nativeBannerAd.load(), setInterval(function () {
      e.nativeBannerAd && e.nativeBannerAd.load();
    }, 1e3 * this.Control_Native_Update));
  }, t.prototype.checkBannerLoadSucc = function () {
    var e = this;
    if (this.loadSucc_Banner = this.loadSucc_NativeInfo && this.loadSucc_NativeAdBanner || this.loadSucc_SystemBanner, console.log("OPPO banner加载成功?", this.loadSucc_Banner, ++this.NUM_CheckBannerLoadSucc), this.timeout_checkBannerLoadSucc && clearTimeout(this.timeout_checkBannerLoadSucc), this.loadSucc_Banner) this.showBanner();else {
      if (this.NUM_CheckBannerLoadSucc >= this.NUM_MaxCheckBannerLoadSucc) return;
      this.timeout_checkBannerLoadSucc = setTimeout(function () {
        e.checkBannerLoadSucc();
      }, 5e3);
    }
  }, t.prototype.showBanner = function () {
    this.loadSucc_Banner ? this.hasShowBanner ? console.log("OPPO 已经调用过showBanner,请勿重复调用") : (this.hasShowBanner = !0, this.SW_System_Banner && this.SW_Native_Banner ? this.Control_First_Native ? this.loadSucc_NativeInfo && this.loadSucc_NativeAdBanner ? this.showNativeBanner() : this.loadSucc_SystemBanner && this.showSystemBanner() : this.loadSucc_SystemBanner ? this.showSystemBanner() : this.loadSucc_NativeInfo && this.loadSucc_NativeAdBanner && this.showNativeBanner() : this.SW_System_Banner ? this.showSystemBanner() : this.SW_Native_Banner && this.showNativeBanner(), this.updateBanner()) : this.checkBannerLoadSucc();
  }, t.prototype.showNativeBanner = function () {
    var e = this;
    this.isShow_NativeBanner && this.hideNativeBanner(), console.log("OPPO 展示原生banner"), this.isShow_NativeBanner = !0;
    var t = cc.director.getScene(),
        o = this.nativeBannerInfo.adId;
    this.nativeBannerAd.reportAdShow({
      adId: o
    }), this.node_nativeBanner = new cc.Node("node_nativeBanner"), t.addChild(this.node_nativeBanner), this.node_nativeBanner.addComponent(cc.Sprite), this.node_nativeBanner.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(this.nativeInfoRes.NativeBannerBg), this.node_nativeBanner.addComponent(cc.Widget), this.node_nativeBanner.getComponent(cc.Widget).isAlignHorizontalCenter = !0, this.node_nativeBanner.getComponent(cc.Widget).isAlignBottom = !0, this.node_nativeBanner.getComponent(cc.Widget).bottom = 0, cc.winSize.width < cc.winSize.height ? (this.node_nativeBanner.width = cc.winSize.width, this.node_nativeBanner.height = 0.2 * cc.winSize.width) : (this.node_nativeBanner.width = cc.winSize.width / 2.2, this.node_nativeBanner.height = 0.16 * this.node_nativeBanner.width), "" != this.AdGroup && (this.node_nativeBanner.group = this.AdGroup), this.node_nativeBanner.zIndex = 29999, this.node_nativeBanner.on(cc.Node.EventType.TOUCH_START, function () {
      e.nativeBannerAd.reportAdClick({
        adId: o
      });
    });
    var a = new cc.Node("adTip");
    this.node_nativeBanner.addChild(a), a.addComponent(cc.Sprite), a.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(this.nativeInfoRes.NativeAdTip), a.height = 0.2 * this.node_nativeBanner.height, a.width = a.height / 0.45, a.x = this.node_nativeBanner.width / 2 - a.width / 2, a.y = this.node_nativeBanner.height / 2 - a.height / 2;
    var n = new cc.Node("icon");
    this.node_nativeBanner.addChild(n), n.addComponent(cc.Sprite), this.nativeBannerInfo.Native_icon ? n.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(this.nativeBannerInfo.Native_icon) : n.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(this.nativeInfoRes.NativeTestIcon), n.height = 0.8 * this.node_nativeBanner.height, n.width = n.height, n.x = this.node_nativeBanner.height / 2 - this.node_nativeBanner.width / 2, n.y = 0;
    var i = new cc.Node("image");
    this.node_nativeBanner.addChild(i), i.addComponent(cc.Sprite), this.nativeBannerInfo.Native_BigImage ? i.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(this.nativeBannerInfo.Native_BigImage) : this.nativeBannerInfo.Native_icon ? i.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(this.nativeBannerInfo.Native_icon) : i.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(this.nativeInfoRes.NativeTestImage), i.height = this.node_nativeBanner.height, i.width = 2.2 * i.height, i.x = -0.15 * i.width;
    var r = new cc.Node("bannerButton");
    this.node_nativeBanner.addChild(r), r.addComponent(cc.Sprite), r.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(this.nativeInfoRes.NativeBannerButton), r.width = 0.3 * this.node_nativeBanner.width, r.height = 0.4 * r.width, r.x = this.node_nativeBanner.width / 2 - 0.6 * r.width, r.y = -0.2 * r.height;
    var s = new cc.Node("banner_btn_txt");
    r.addChild(s), s.addComponent(cc.Label);
    var l = s.getComponent(cc.Label);
    l.string = this.nativeBannerInfo.clickBtnTxt, l.fontSize = 0.4 * r.height, l.horizontalAlign = cc.Label.HorizontalAlign.CENTER, l.verticalAlign = cc.Label.VerticalAlign.CENTER, l.enableBold = !0, s.color = cc.Color.WHITE, s.addComponent(cc.LabelOutline), s.getComponent(cc.LabelOutline).color = cc.Color.BLACK;

    var _ = new cc.Node("titleLabel");

    this.node_nativeBanner.addChild(_), _.addComponent(cc.Label);

    var c = _.getComponent(cc.Label);

    cc.winSize.width < cc.winSize.height ? c.fontSize = cc.view.getDesignResolutionSize().width / 1080 * 35 : c.fontSize = cc.view.getDesignResolutionSize().height / 1080 * 35, "" == this.nativeBannerInfo.desc ? c.string = this.nativeBannerInfo.title : c.string = this.nativeBannerInfo.desc, c.enableBold = !0, c.horizontalAlign = cc.Label.HorizontalAlign.CENTER, c.verticalAlign = cc.Label.VerticalAlign.CENTER, c.lineHeight = c.fontSize, _.color = cc.Color.WHITE, _.addComponent(cc.LabelOutline), _.getComponent(cc.LabelOutline).color = cc.Color.BLACK, _.y = this.node_nativeBanner.height / 2 - 0.35 * _.height, _.x = 0;
    var d = new cc.Node("NativeClose");
    this.node_nativeBanner.addChild(d), d.addComponent(cc.Sprite), d.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(this.nativeInfoRes.NativeBannerClose), d.width = 0.27 * this.node_nativeBanner.height, d.height = 0.27 * this.node_nativeBanner.height, d.x = -this.node_nativeBanner.width / 2 + d.width / 2, d.y = this.node_nativeBanner.height / 2 - d.width / 2;
    var h = new cc.Node("closeButton");
    this.node_nativeBanner.addChild(h), h.width = d.height, h.height = d.height, h.x = -this.node_nativeBanner.width / 2 + d.width / 2, h.y = this.node_nativeBanner.height / 2 - d.width / 2, h.zIndex = 29999, h.on(cc.Node.EventType.TOUCH_START, function (t) {
      console.log("OPPO 原生banner关闭", e.Control_Banner_Update + "S后再次刷新"), e.hideBanner(), t.stopPropagation();
    });
  }, t.prototype.showSystemBanner = function () {
    var e = this;
    this.bannerAd ? (this.isShow_SystemBanner = !0, this.bannerAd.show()) : (this.createSystemBanner(), this.timeout_showSystemBanner = setTimeout(function () {
      e.bannerAd && e.showSystemBanner();
    }, 1e3));
  }, t.prototype.updateBanner = function () {
    var e = this;
    this.interval_updateBanner && clearInterval(this.interval_updateBanner), this.interval_updateBanner = setInterval(function () {
      e.SW_System_Banner && e.SW_Native_Banner ? e.Control_First_Native ? e.loadSucc_NativeInfo && e.loadSucc_NativeAdBanner ? e.updateNativeBanner() : e.loadSucc_SystemBanner && e.updateSystemBanner() : e.loadSucc_SystemBanner ? e.updateSystemBanner() : e.loadSucc_NativeInfo && e.loadSucc_NativeAdBanner && e.updateNativeBanner() : e.SW_System_Banner ? e.updateSystemBanner() : e.SW_Native_Icon && e.updateNativeBanner();
    }, 1e3 * this.Control_Banner_Update);
  }, t.prototype.updateSystemBanner = function () {
    var e = this;
    this.hideNativeBanner(), this.hideSystemBanner(), this.createSystemBanner(), this.timeout_showSystemBanner = setTimeout(function () {
      e.bannerAd && e.showSystemBanner();
    }, 1e3);
  }, t.prototype.updateNativeBanner = function () {
    this.hideNativeBanner(), this.hideSystemBanner(), this.showNativeBanner();
  }, t.prototype.hideBanner = function () {
    this.hasShowBanner = !1, this.hideNativeBanner(), this.hideSystemBanner(), this.interval_updateBanner && clearInterval(this.interval_updateBanner), this.timeout_showSystemBanner && clearTimeout(this.timeout_showSystemBanner), this.timeout_checkBannerLoadSucc && clearTimeout(this.timeout_checkBannerLoadSucc);
  }, t.prototype.hideSystemBanner = function () {
    this.isShow_SystemBanner && this.bannerAd && (this.isShow_SystemBanner = !1, this.bannerAd.destroy());
  }, t.prototype.hideNativeBanner = function () {
    this.isShow_NativeBanner = !1, this.node_nativeBanner && (this.node_nativeBanner.removeFromParent(), this.node_nativeBanner = null);
  }, t.prototype.showOppoCustom = function () {
    var e = this;
    n["default"].stringHasSpace(this.ID_Custom_Inters) ? console.log("当前渠道模板广告ID中含有空字符串,请检查后台模板广告ID*********************") : (console.log("OPPO showOppoCustom========================", this.SW_Custom_Inters), this.SW_Custom_Inters && "" != this.ID_Custom_Inters && (this.customIntersAd = qg.createCustomAd({
      adUnitId: this.ID_Custom_Inters,
      style: {}
    }), this.customIntersAd.onLoad(function () {
      console.log("OPPO 展示原生模板广告");
    }), this.customIntersAd.show().then(function () {
      console.log("OPPO 展示原生模板广告展示成功=================="), e.hideBanner();
    })["catch"](function (e) {
      console.log("OPPO 展示原生模板广告展示错误:" + JSON.stringify(e));
    }), this.customIntersAd.onError(function (e) {
      console.log("OPPO 原生模板广告加载失败", JSON.stringify(e));
    }), this.customIntersAd.onHide(function () {
      console.log("OPPO 原生模板插屏广告关闭"), e.hideCustomAd();
    })));
  }, t.prototype.hideCustomAd = function () {
    this.customIntersAd && (console.log("OPPO hideCustomAd========================"), this.customIntersAd.offHide(), this.customIntersAd.hide(), this.customIntersAd.destroy(), this.showBanner());
  }, t.prototype.createNavigateBoxBanner = function () {
    n["default"].stringHasSpace(this.ID_Box_Banner) ? console.log(n["default"].GameName + "当前渠道互推盒子横幅广告ID中含有空字符串,请检查后台互推盒子横幅广告ID*********************") : qg.getSystemInfoSync().platformVersionCode < 1076 ? console.log("OPPO 版本较低,不支持互推盒子广告") : (this.navigateBoxBannerAd = qg.createGameBannerAd({
      adUnitId: this.ID_Box_Banner
    }), this.loadSucc_NavigateBoxBanner = !0, this.navigateBoxBannerAd.onError(function (e) {
      console.log("OPPO 互推盒子横幅广告出错:", JSON.stringify(e));
    }));
  }, t.prototype.getNavigateBoxBannerFlag = function () {
    return this.loadSucc_NavigateBoxBanner;
  }, t.prototype.showNavigateBoxBanner = function () {
    this.isShow_NavigateSettle ? console.log("已经调用过showNavigateBoxBanner,请勿重复调用") : (this.isShow_NavigateSettle = !0, this.loadSucc_NavigateBoxBanner && (this.temp_hasShowBanner = this.hasShowBanner, this.hideBanner(), this.navigateBoxBannerAd.show()));
  }, t.prototype.hideNavigateBoxBanner = function () {
    this.isShow_NavigateSettle && (this.isShow_NavigateSettle = !1, this.navigateBoxBannerAd && (this.navigateBoxBannerAd.destroy(), this.createNavigateBoxBanner()));
  }, t.prototype.createNavigateBoxPortal = function () {
    var e = this;
    n["default"].stringHasSpace(this.ID_Box_View) ? console.log(n["default"].GameName + "当前渠道互推盒子九宫格广告ID中含有空字符串,请检查后台互推盒子九宫格广告ID*********************") : (console.log("OPPO 创建互推盒子九宫格广告"), qg.getSystemInfoSync().platformVersionCode < 1076 ? console.log("OPPO 版本较低,不支持互推盒子广告") : (this.navigateBoxPortalAd = qg.createGamePortalAd({
      adUnitId: this.ID_Box_View
    }), this.navigateBoxPortalAd.onLoad(function () {
      console.log("ChaoQiGameSDK", "OPPO 互推盒子九宫格广告加载完成"), e.loadSucc_NavigateBoxPortal = !0;
    }), this.navigateBoxPortalAd.onError(function (t) {
      console.log("ChaoQiGameSDK", "OPPO 互推盒子九宫格广告加载/展示失败：", JSON.stringify(t)), e.loadSucc_NavigateBoxPortal = !1, setTimeout(function () {
        e.navigateBoxPortalAd.load();
      }, 2e4);
    }), this.navigateBoxPortalAd.onClose(function () {
      console.log("ChaoQiGameSDK", "OPPO 互推盒子九宫格广告关闭"), e.navigateBoxPortalAd.load(), e.temp_hasShowBanner && e.showBanner();
    }), this.navigateBoxPortalAd.load()));
  }, t.prototype.getNavigateBoxPortalFlag = function () {
    return console.log("OPPO 九宫格是否记载完成：", this.loadSucc_NavigateBoxPortal), this.loadSucc_NavigateBoxPortal;
  }, t.prototype.showNavigateBoxPortal = function () {
    this.loadSucc_NavigateBoxPortal && (this.temp_hasShowBanner = this.hasShowBanner, this.hideBanner(), this.navigateBoxPortalAd.show());
  }, t.prototype.hideNavigateBoxPortal = function () {
    this.isShow_NavigateSettle && (console.log("OPPO hideNavigateBoxBanner====================="), this.isShow_NavigateSettle = !1, this.navigateBoxBannerAd && this.navigateBoxBannerAd.hide());
  }, t.prototype.setGroup = function (e) {
    this.AdGroup = e;
  }, t.prototype.hasAddDesktopFunc = function () {
    return !0;
  }, t.prototype.getAddDesktopFlag = function (e) {
    qg.hasShortcutInstalled({
      success: function success(t) {
        0 == t ? (console.log("OPPO 不存在桌面图标"), e(!0)) : (console.log("OPPO 已存在桌面图标"), e(!1));
      },
      fail: function fail(t) {
        console.log("OPPO qg.hasShortcutInstalled err：", JSON.stringify(t)), e(!1);
      },
      complete: function complete() {}
    });
  }, t.prototype.addDesktop = function (e) {
    qg.installShortcut({
      success: function success() {
        console.log("OPPO 添加桌面成功"), e(!0);
      },
      fail: function fail(t) {
        console.log("OPPO 添加桌面失败:" + JSON.stringify(t)), e(!1);
      },
      complete: function complete() {}
    });
  }, t.prototype.phoneVibrate = function (e) {
    "short" == e ? qg.vibrateShort({
      success: function success() {},
      fail: function fail() {},
      complete: function complete() {}
    }) : "long" == e && qg.vibrateLong({
      success: function success() {},
      fail: function fail() {},
      complete: function complete() {}
    });
  }, t.prototype.getErrorControl = function () {
    var e = !1;
    return this.getGameTestVersion() || (e = this.adErrorControl()), e;
  }, t.prototype.getNativeImageErrorControl = function () {
    return !!this.getErrorControl() && this.getNativeImageError();
  }, t.prototype.getNativeIntersErrorControl = function () {
    return !!this.getErrorControl() && this.getNativeIntersError();
  }, t.prototype.getCustomErrorControl = function () {
    return !!this.getErrorControl() && this.getCustomError();
  }, oo([s], t);
}(i["default"]));
o["default"] = l;

cc._RF.pop();